package ca.seia.comp6521.a2.itemsetstorage;

/**
 * @author itoe
 *
 */
public class CharPair implements ExternilizableItems{
	
	private char valueOne;
	private char valueTwo;
	
	public CharPair(char valueOne, char valueTwo) {
		this.valueOne = valueOne;
		this.valueTwo = valueTwo;
	}
	
	public CharPair(int valueOne, int valueTwo) {
		this.valueOne = (char) valueOne;
		this.valueTwo = (char) valueTwo;
	}

	public char getValueOne() {
		return valueOne;
	}

	public void setValueOne(char valueOne) {
		this.valueOne = valueOne;
	}

	public char getValueTwo() {
		return valueTwo;
	}

	public void setValueTwo(char valueTwo) {
		this.valueTwo = valueTwo;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + valueOne;
		result = prime * result + valueTwo;
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		CharPair other = (CharPair) obj;
		if (valueOne != other.valueOne)
			return false;
		if (valueTwo != other.valueTwo)
			return false;
		return true;
	}

	@Override
	public String toString() {
		return "CharPair [valueOne=" + valueOne + ", valueTwo=" + valueTwo + "]";
	}

	@Override
	public String toExternalFormat() {
		return this.getValueOne() + " " + this.getValueTwo();
	}
	
}
